/**
 * CS575 Software Design
 * Group 6
 * Group Members: Anthony Davidson, Kendra Scheesley, Lyndsey Whitman, Stephen Zakrewsky
 * Date: May 19, 2012
 * Main Author(s): Lyndsey Whitman
 */
package edu.drexel.cs575.a3;

public class SingleWeighableItem implements WeighableItem
{
	private String name;
	private double mass;
	private double pricePerMassUnit;
	private CalculatePrice priceCalc;

	public SingleWeighableItem()
	{
		this.name             = "";
		this.mass             = 0.0;
		this.pricePerMassUnit = 0.0;
		this.priceCalc        = new Price();
	}

	public SingleWeighableItem(String name, double mass, double pricePerMassUnit)
	{
		this.name             = name;
		this.mass             = mass;
		this.pricePerMassUnit = pricePerMassUnit;
		this.priceCalc        = new Price();
	}

	@Override
	public String getName()
	{
		return name;
	}

	@Override
	public void setName(String name)
	{
		this.name = name;
	}

	@Override
	public double getMass()
	{
		return mass;
	}

	public void setMass(double mass)
	{
		this.mass = mass;
	}
	
	@Override
	public double calculatePricePerMassUnit()
	{
		double price = priceCalc.calculatePrice(mass, pricePerMassUnit);
		
		return price;
	}

	public void setPricePerMassUnit(double pricePerMassUnit)
	{
		this.pricePerMassUnit = pricePerMassUnit;
	}
	
	@Override
	public int getNumberOfItems()
	{
		return 1;
	}
}
